// 标签
// 目录
// 学科
// 导入封装的请求实例
import request from '@/utils/request'
// 查询
export const getTagListApi = params => {
  return request({
    url: '/subject/tag',
    method: 'get',
    params
  })
}
export const getTagInfoApi = (id) => {
  return request({
    url: `/subject/tag/${id}`,
    method: 'get'
  })
}

// 增加
export const addTagListApi = data => {
  return request({
    url: '/subject/tag',
    method: 'post',
    data
  })
}
// 删除
export const deleteTagListApi = data => {
  return request({
    url: `subject/tag/${data}`,
    method: 'delete'
  })
}

// 修改
export function updateTagApi(data) {
  return request({
    url: `/subject/tag/${data.id}`,
    method: 'put',
    data
  })
}

// 是否显示
export const isShowApi = data => {
  // params 提交的是 { id:142}
  return request({
    url: `/subject/tag/${data.id}`,
    method: 'put',
    data
  })
}

export const getTreeList = () => {
  return request({
    url: '/subject/tree',
    method: 'get'
  })
}
